"""
数据库工具函数
"""

def dictfetchall(cursor):
    """将游标返回的结果转换为字典列表"""
    columns = [col[0] for col in cursor.description]
    return [
        dict(zip(columns, row))
        for row in cursor.fetchall()
    ] 